package org.ben.test.addition;

import java.util.Random;
import java.util.Scanner;

/**
 * @Author: Ben
 * @Date: 2019/9/23 18:22
 */
public class Addition1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);

        int judgment=0;
        do {
            System.out.println("请输入猜测的数据：");
            int a=scanner.nextInt();
            Random random = new Random();
            int realNumber = random.nextInt(100)+1;
            if (a > realNumber) {
                System.out.println("猜大了");
            } else if (a == realNumber) {
                System.out.println("猜对了");
            } else {
                System.out.println("猜小了");
            }

            System.out.println("您是否要继续：如果要请按1，否则请按2");
           judgment=scanner.nextInt();
        }while (judgment==1);
    }
}
